package com.usian.search.controller;

import com.usian.apis.search.ApAssociateWordsControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.search.UserSearchDto;
import com.usian.search.service.ApAssociateWordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: ApAssociateWordsController
 * Author:   WGG
 * Date:    2022-12-2022/12/11-8:51
 * Version: 1.0
 * Description:
 */
@RestController
@RequestMapping("/search/apAssociateWords")
public class ApAssociateWordsController implements ApAssociateWordsControllerApi {

    @Autowired
    private ApAssociateWordsService apAssociateWordsService;

    @Override
    @PostMapping("/findByLike")
    public ResponseResult findByLike(@RequestBody UserSearchDto dto) {
        return apAssociateWordsService.findByLike(dto);
    }

    @Override
    @PostMapping("/searchRedis")
    public ResponseResult searchRedis(@RequestBody UserSearchDto dto) {
        return apAssociateWordsService.searchRedis(dto);
    }
}
